home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
114
/
ezscreen
/
test.lst
< prev
next >
Wrap
File List
|
1987-10-10
|
7KB
|
371 lines
'
Gosub Init
'
Gosub Ez_screen_demo
'
Procedure Init
Dim Scr$(24)
Return
'
Procedure Display_screen
cls
Gosub Normvideo
For Y=1 To 24
Print At(1,Y);scr$(y);
Next Y
Return
'
Procedure Decipher_it
L=1
Repeat
Print At(X,Y);chr$(0);
Void Xbios(21,1)
Valid=False
Gosub Inversevideo
Repeat
T$=Inkey$
Until Asc(Right$(T$,1))<>0
'
If Type$=chr$(65) And ((Asc(T$)=>65 And Asc(T$)<=90) Or (Asc(T$)=>97 And Asc(T$)<=122) Or (Asc(T$)=>48 And Asc(T$)<=57)) Then
Valid=True
Endif
'
If Type$=chr$(78) And Asc(T$)=>48 And Asc(T$)<=57 Then
Valid=True
Endif
'
If Type$=chr$(67) And ((Asc(T$)=>65 And Asc(T$)<=90) Or (Asc(T$)=>97 And Asc(T$)<=122)) Then
Valid=True
Endif
'
If T$=chr$(32) Or T$=chr$(45) Or T$=chr$(46) Then
Valid=True
Endif
'
If Valid=True Then
Print At(X,Y);T$;
Add X,1
Zz$=chr$(0)
Mid$(User$,L,1)=Left$(T$,1)
Add L,1
Endif
'
If Valid=False Then
Zz$=Right$(T$,1)
'
If len(t$)=delimiter_length and Asc(Zz$)=delimiter_value Then
Dun=True
Endif
'
' LEFT ARROW, BACKSPACE OR DELETE
'
If Asc(Zz$)=75 Or Asc(Zz$)=127 Or Asc(Zz$)=8 Then
If X>X_start Then
Sub X,1
Sub L,1
Endif
Endif
'
' RIGHT ARROW
'
If Asc(Zz$)=77 Then
If X<X_end Then
Add X,1
Add L,1
Endif
Endif
'
' UP ARROW
'
If Asc(Zz$)=72 And In_line>1 Then
In_line=In_line-2
X=X_end+1
T$=chr$(0)
Endif
'
' DOWN ARROW
'
If Asc(Zz$)=80 Then
X=X_end+1
T$=chr$(0)
Endif
Endif
'
If Asc(T$)<>0 Then
Print At(X,Y);chr$(0);
Endif
Until Asc(T$)=10 Or Asc(T$)=13 Or X>X_end Or Dun=True
If Dun=False Then
Add In_line,1
Endif
Return
'
Procedure Inversevideo
iv$=chr$(27)+chr$(112)
Print iv$ ;
Return
'
Procedure Normvideo
Nv$=chr$(27)+chr$(113)
print nv$ ;
Return
'
Procedure You_are_done
'
' anything you want to do as cleanup belongs here
'
cls
Gosub Normvideo
Return
'
' <<<<<<<<<<<<<< only uniquely coded procedures after this point
'
Procedure Ez_screen_demo
'
' declare variables
'
' *****
Delimiter_value=71
Delimiter_length=2
nmbr$=Space$(3)
first_name$=Space$(10)
last_name$=Space$(19)
street$=Space$(29)
city$=Space$(29)
state$=Space$(2)
zip$=Space$(5)
zip_ext$=Space$(4)
area_code$=Space$(3)
phone_1$=Space$(3)
phone_2$=Space$(4)
'
'
' If there is any existing data, call a user
'
' supplied procedure to read it here
'
'
' Assign screen data
'
Gosub Screen_Assign_demo
'
' display screen mask
'
Gosub Display_screen
'
' display existing data if any
'
Gosub Display_user_data_demo
'
' now go do the actual screen input
'
' repeat calls to this procedure as necessary
'
Gosub Get_data_demo
'
' the program is done at this point
'
Gosub You_are_done
'
'
Return
'
Procedure Get_data_demo
In_line=1
Dun=False
'
' LIMIT is the number of fields in the input screen
'
' *****
Limit=11
'
' these calls set up the cursor to blink
'
Void Xbios(21,2)
Void Xbios(21,4,10)
Repeat
'
' each input field requires its own if...then construct here
'
'******
If In_line=1 Then
Type$="N"
User$=nmbr$
X_start=26
X_end=28
X=X_start
Y=7
Gosub Decipher_it
nmbr$=User$
Endif
If In_line=2 Then
Type$="C"
User$=first_name$
X_start=26
X_end=35
X=X_start
Y=9
Gosub Decipher_it
first_name$=User$
Endif
If In_line=3 Then
Type$="C"
User$=last_name$
X_start=26
X_end=44
X=X_start
Y=11
Gosub Decipher_it
last_name$=User$
Endif
If In_line=4 Then
Type$="A"
User$=street$
X_start=26
X_end=54
X=X_start
Y=13
Gosub Decipher_it
street$=User$
Endif
If In_line=5 Then
Type$="A"
User$=city$
X_start=26
X_end=54
X=X_start
Y=15
Gosub Decipher_it
city$=User$
Endif
If In_line=6 Then
Type$="A"
User$=state$
X_start=26
X_end=27
X=X_start
Y=17
Gosub Decipher_it
state$=User$
Endif
If In_line=7 Then
Type$="N"
User$=zip$
X_start=26
X_end=30
X=X_start
Y=19
Gosub Decipher_it
zip$=User$
Endif
If In_line=8 Then
Type$="N"
User$=zip_ext$
X_start=32
X_end=35
X=X_start
Y=19
Gosub Decipher_it
zip_ext$=User$
Endif
If In_line=9 Then
Type$="N"
User$=area_code$
X_start=26
X_end=28
X=X_start
Y=21
Gosub Decipher_it
area_code$=User$
Endif
If In_line=10 Then
Type$="N"
User$=phone_1$
X_start=30
X_end=32
X=X_start
Y=21
Gosub Decipher_it
phone_1$=User$
Endif
If In_line=11 Then
Type$="N"
User$=phone_2$
X_start=34
X_end=37
X=X_start
Y=21
Gosub Decipher_it
phone_2$=User$
Endif
If In_line>Limit Then
In_line=1
Endif
Until Dun=True
Void Xbios(21,0)
Return
'
Procedure Display_user_data_demo
'
' call this procedure to display any existing data
'
Gosub Inversevideo
'
' print any existing data with print at(x,y);???
'
' *****
Print At(26,7);nmbr$
Print At(26,9);first_name$
Print At(26,11);last_name$
Print At(26,13);street$
Print At(26,15);city$
Print At(26,17);state$
Print At(26,19);zip$
Print At(32,19);zip_ext$
Print At(26,21);area_code$
Print At(30,21);phone_1$
Print At(34,21);phone_2$
Gosub Normvideo
'
Return
'
Procedure Screen_assign_demo
cls
'
'
' *****
Scr$(1)=" "
Scr$(2)=" "
Scr$(3)=" EZ_SCREEN registered user list "
Scr$(4)=" "
Scr$(5)=" "
Scr$(6)=" "
Scr$(7)=" registration number "
Scr$(8)=" "
Scr$(9)=" first name "
Scr$(10)=" "
Scr$(11)=" last name "
Scr$(12)=" "
Scr$(13)=" street "
Scr$(14)=" "
Scr$(15)=" city "
Scr$(16)=" "
Scr$(17)=" state "
Scr$(18)=" "
Scr$(19)=" zip - "
Scr$(20)=" "
Scr$(21)=" phone - - "
Scr$(22)=" "
Scr$(23)=" "
Scr$(24)=" "
Return
'